package po;

import java.awt.Image;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.Serializable;

import javax.imageio.ImageIO;

public class AdvertisePO implements Serializable{
	private static final long serialVersionUID = 1L;
	private byte[] imageData;
	
	public AdvertisePO(byte[] imageData){
		this.imageData=imageData;
	}
	
	public Image getImage(){
		
		try {
			ByteArrayInputStream bais=new ByteArrayInputStream(imageData);
			Image image=ImageIO.read(bais);
			return image;
		} catch (IOException e) {
			e.printStackTrace();
			return null;
		}
	}
}
